package com.mo.tools.poi.watermark;

/**
 * 水印功能测试类
 */
public class WatermarkTest {
    
    public static void main(String[] args) {
        System.out.println("开始测试水印功能...");
        
        // 测试普通水印
        try {
            String inputFile = "test.jpg";
            String outputFile = "test_watermarked.jpg";
            String watermarkText = "测试水印";
            
            WatermarkUtil.addWatermark(inputFile, outputFile, watermarkText);
            System.out.println("普通水印测试完成");
        } catch (Exception e) {
            System.out.println("普通水印测试失败: " + e.getMessage());
        }
        
        // 测试默认样式平铺水印
        try {
            String inputFile = "test.png";
            String outputFile = "test_tiled.png";
            String watermarkText = "平铺水印";
            
            WatermarkUtil.addWatermark(inputFile, outputFile, watermarkText);
            System.out.println("默认样式平铺水印测试完成");
        } catch (Exception e) {
            System.out.println("默认样式平铺水印测试失败: " + e.getMessage());
        }
        
        // 测试自定义样式平铺水印
        try {
            String inputFile = "test.bmp";
            String outputFile = "test_custom.bmp";
            String watermarkText = "自定义水印";
            String fontName = "宋体";
            int fontSize = 24;
            String colorHex = "#FF0000";
            
            WatermarkUtil.addWatermarkWithStyle(inputFile, outputFile, watermarkText, fontName, fontSize, colorHex, null, null);
            System.out.println("自定义样式平铺水印测试完成");
        } catch (Exception e) {
            System.out.println("自定义样式平铺水印测试失败: " + e.getMessage());
        }
        
        System.out.println("所有水印测试完成");
    }
}